home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 2 / 002.d81 / address keeper (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  397 lines

  1. 10 rem
  2. 20 rem address keeper by donna k. woody
  3. 30 :
  4. 40 poke53272,23:rem selects upper/lower case
  5. 50 printchr$(8):rem disables c/shift keys
  6. 60 poke53280,5:rem set border color to green
  7. 70 poke53281,1:rem set background color to white
  8. 80 printchr$(30):rem set character color to green
  9. 90 :
  10. 100 rem initialize variables
  11. 110 :
  12. 120 gosub3800:goto210
  13. 130 :
  14. 140 rem most used subroutines
  15. 150 :
  16. 160 poke204,0:poke207,0:getz$:return
  17. 170 printtab(16+len(q$)+1)"[145][145]";:fork=len(q$)+1tobc:printchr$(32);:next:return
  18. 180 :
  19. 190 rem title, instructions & main menu
  20. 200 :
  21. 210 printchr$(147):printtab(6)a1$
  22. 220 print:print:printtab(12)"0.  [197]xit program"
  23. 230 print:printtab(12)"1.  [201]nstructions"
  24. 240 print:printtab(12)"2.  [197]nter names"
  25. 250 print:printtab(12)"3.  [195]hange/[193]dd names"
  26. 260 print:printtab(12)"4.  [208]rint names"
  27. 270 print:print:print
  28. 280 print"[197]nter selection [0 - 4]: ";
  29. 290 gosub160:ifz$=""then290
  30. 300 poke204,1:print
  31. 310 z=val(z$):ifz=0thenifz$="0"then390
  32. 315 ifz=0then200
  33. 320 t=1
  34. 330 ifz>4thenzz=6:zy=15:gosub2470:goto280
  35. 340 onzgosub2220,430,1700,1860
  36. 350 forx=1to100:name$(x)="":adr$(x)="":city$(x)="":state$(x)="":zip$(x)=""
  37. 360 ph$(x)="":next
  38. 370 flag=0
  39. 380 goto210
  40. 390 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  41. 395 poke631,13:poke632,13:poke198,2:end
  42. 400 :
  43. 410 rem input routine
  44. 420 :
  45. 430 forx=tto100
  46. 440 printchr$(147):printtab(6)a1$
  47. 450 print"[213]sing this option with create a new"
  48. 460 print"[193][196][196][210][197][211][211] [198][201][204][197].  [201]f you have an existing"
  49. 470 print"file that you want to add to, return to"
  50. 480 print"the [205]ain [205]enu and take the [195]hange/[193]dd "
  51. 490 print"option."
  52. 500 print"[196]o you want to continue with this option(y/n)? ";
  53. 510 gosub160:ifz$=""then510
  54. 520 poke204,1:print:ifz$="n"orz$="[206]"thenreturn
  55. 530 forx=tto100
  56. 540 flag=0
  57. 550 printchr$(147):printtab(6)a1$
  58. 560 print"[197]nter <[209]> to end entry."
  59. 570 print"[206]ame:";:gosub2510:printtab(16)"[145]";:bc=22:gosub2570:name$(x)=q$
  60. 580 ifflag=1thenflag=0:cc=x-1:x=100:goto680
  61. 590 print"[211]treet address:";:gosub2510:printtab(16)"[145]";
  62. 600 bc=22:gosub2570:adr$(x)=q$
  63. 610 print"[195]ity:";:gosub2510:printtab(16)"[145]";:bc=22:gosub2570:city$(x)=q$
  64. 620 print"[211]tate:";:gosub2520:printtab(16)"[145]";:bc=3:gosub3320:zz=11:zy=9
  65. 630 gosub3210:ifflag=0thenprint:goto620
  66. 640 state$(x)=q$
  67. 650 print"";:fork=1to29:printchr$(32);:next:print"[145][145][145][145][145][145][145][145][145][145][145][145]"
  68. 660 print"[218]ip code:";:gosub2530:printtab(16)"[145]";:bc=6:gosub2820:zip$(x)=q$
  69. 670 print"[208]hone number:";:gosub2540:printtab(16)"[145]";:bc=13:gosub3000:ph$(x)=q$
  70. 680 next
  71. 690 printchr$(147):printtab(6)a1$
  72. 700 print"[206]ow ready to check names and addresses"
  73. 710 print"for errors before writing them to disk."
  74. 720 print""a2$;
  75. 730 gosub160:ifz$=""then730
  76. 740 poke204,1:print
  77. 750 :
  78. 760 rem check for typos & change
  79. 770 :
  80. 780 forx=1tocc
  81. 790 printchr$(147):printtab(6)a1$
  82. 800 print"[206]ame:";:gosub2510:printtab(16)"[145]"name$(x)
  83. 810 print"[193]ddress:";:gosub2510:printtab(16)"[145]"adr$(x)
  84. 820 print"[195]ity:";:gosub2510:printtab(16)"[145]"city$(x)
  85. 830 print"[211]tate:";:gosub2520:printtab(16)"[145]"state$(x)
  86. 840 print"[218]ip code:";:gosub2530:printtab(16)"[145]"zip$(x)
  87. 850 print"[208]hone number:";:gosub2540:printtab(16)"[145]"ph$(x)
  88. 860 print"[201]ndicate item to change:"
  89. 870 print"   <[206]>ame, <[193]>ddress, <[195]>ity, <[211]>tate,"
  90. 880 print"   <[218]>ip, <[208]>hone number, <[199]>et next"
  91. 890 :print"[197]nter letter: ";
  92. 900 gosub160:ifz$=""then900
  93. 910 poke204,1:print"[146] "
  94. 920 print"";:fork=1to29:printchr$(32);:next:print"[145][145][145][145][145][145]"
  95. 930 ifz$="[206]"orz$="n"then1010
  96. 940 ifz$="a"orz$="[193]"then1040
  97. 950 ifz$="c"orz$="[195]"then1070
  98. 960 ifz$="[211]"orz$="s"then1100
  99. 970 ifz$="[218]"orz$="z"then1150
  100. 980 ifz$="p"orz$="[208]"then1170
  101. 990 ifz$="g"orz$="[199]"then1190
  102. 1000 zz=5:zy=13:gosub2470;:goto860
  103. 1010 printchr$(19)"";tab(16);:bc=22:gosub2570:name$(x)=q$
  104. 1020 gosub170
  105. 1030 print"":goto860
  106. 1040 printchr$(19)"";tab(16);:bc=22:gosub2570:adr$(x)=q$
  107. 1050 gosub170
  108. 1060 print"":goto860
  109. 1070 printchr$(19)"";tab(16);:bc=22:gosub2570:city$(x)=q$
  110. 1080 gosub170
  111. 1090 print"":goto860
  112. 1100 printchr$(19)"";tab(16);:bc=3:gosub3320:zz=13:zy=7:gosub3210
  113. 1110 ifflag=0thenprint:goto1100
  114. 1120 state$(x)=q$
  115. 1130 print"";:fork=1to29:printchr$(32);:next:print"[145][145][145][145][145][145][145][145][145][145][145][145]"
  116. 1140 print:goto860
  117. 1150 printchr$(19)"";tab(16);:bc=6:gosub2820:zip$(x)=q$
  118. 1160 print:goto860
  119. 1170 printchr$(19)"";tab(16);:bc=13:gosub3000:ph$=q$
  120. 1180 print"[145][145]":goto860
  121. 1190 next
  122. 1200 printchr$(147):printtab(6)a1$
  123. 1210 print"[208]lease have patience with me..."
  124. 1220 print"[201] am writing information to the disk."
  125. 1230 close15:open15,8,15,"r0:address file=address file":gosub3940:close15
  126. 1240 ifcz=62thenclose4:open4,8,4,"0:address file,seq,w":goto1550
  127. 1250 ifcz=72then1450
  128. 1260 ifcz=63then1290
  129. 1270 ifcz>20then1500
  130. 1280 goto1200
  131. 1290 printchr$(147):printtab(6)a1$
  132. 1300 print"[193][196][196][210][197][211][211][160][198][201][204][197] already exists.  [201]f you"
  133. 1310 print"want to save the changes or entries you"
  134. 1320 print"have made, the existing file must be"
  135. 1330 print"deleted before the new information can"
  136. 1340 print"be saved.  [201]f you do not enter 'yes',"
  137. 1350 print"you will be sent back to the main menu"
  138. 1360 print"and your data will be lost.  [217]ou may"
  139. 1370 print"put in a new disk and answer 'yes' to"
  140. 1380 print"keep both sets of data.  [196]o you wish to"
  141. 1390 input"save your changes/entries (yes/no) ";z$
  142. 1400 ifz$="yes"orz$="[217][197][211]"then 1420
  143. 1410 return
  144. 1420 close4:open4,8,4,"0:adf.temp,seq,w":gosub1550
  145. 1430 print"[208]lease wait...":close15:open15,8,15,"s0:address file":close15
  146. 1440 close15:open15,8,15,"r0:address file=adf.temp":close15:return
  147. 1450 print"[212]his disk is full."
  148. 1460 print"[208]lease place another disk in the drive."
  149. 1470 print""a2$;
  150. 1480 gosub160:ifz$=""then1480
  151. 1490 poke204,1:print"[146] ":goto1200
  152. 1500 print"[201] have detected an error in trying to"
  153. 1510 print"write to the disk.  [212]he error is:"
  154. 1520 print""cz,mz$,tz,sz
  155. 1530 print"[211]ince this may be an irrecoverable"
  156. 1540 print"error, the program is being terminated.":close4:close15:end
  157. 1550 print#4,cc
  158. 1560 forx=1tocc
  159. 1570 print#4,name$(x)
  160. 1580 print#4,addr$(x)
  161. 1590 print#4,city$(x)
  162. 1600 print#4,state$(x)
  163. 1610 print#4,zip$(x)
  164. 1620 print#4,ph$(x)
  165. 1630 next
  166. 1640 close4
  167. 1650 printchr$(147):printtab(6)a1$
  168. 1660 print"[196]ata has been written to the disk.":fork=1to500:next:return
  169. 1670 :
  170. 1680 remchange names
  171. 1690 :
  172. 1700 gosub3500
  173. 1710 printchr$(147):printtab(6)a1$
  174. 1720 print"[217]ou may choose to:"
  175. 1730 print"     0.  [210]eturn to [205]ain [205]enu"
  176. 1740 print"     1.  [205]ake [195]hanges"
  177. 1750 print"     2.  [205]ake [193]dditions"
  178. 1760 print"[197]nter selection (0 - 2): ";
  179. 1770 gosub160:ifz$=""then1770
  180. 1780 poke204,1:print"[146] ":print:z=val(z$)
  181. 1790 ifz=0thenreturn
  182. 1800 ifz=1thengoto780
  183. 1810 ifz=2thent=cc+1:goto530
  184. 1820 zz=7:zy=10:gosub2470:goto1760
  185. 1830 :
  186. 1840 rem print routine
  187. 1850 :
  188. 1860 gosub3500
  189. 1870 printchr$(147):printtab(6)a1$
  190. 1880 flag=0
  191. 1890 print"[217]ou may print to:"
  192. 1900 print"     0.  [210]eturn to [205]ain [205]enu"
  193. 1910 print"     1.  [204]abels"
  194. 1920 print"     2.  [204]ist"
  195. 1930 print"[197]nter selection (0 - 2): ";
  196. 1940 gosub160:ifz$=""then1940
  197. 1950 poke204,1:print"[146] ":print:z=val(z$)
  198. 1960 ifz=0then return
  199. 1970 ifz=1thenflag=1:goto 2000
  200. 1980 ifz=2thenflag=0:goto2000
  201. 1990 zz=6:zy=10:gosub2470:goto1930
  202. 2000 printchr$(147):printtab(6)a1$
  203. 2010 print"[208]lease make sure printer is on"
  204. 2020 print"and paper or labels are lined up.":print""a2$;
  205. 2030 gosub160:ifz$=""then2030
  206. 2040 poke204,1:print"[146] "
  207. 2050 open4,4,7
  208. 2060 forx=1tocc
  209. 2070 print#4,name$(x)
  210. 2080 print#4,adr$(x)
  211. 2090 print#4,city$(x);:print#4,",";
  212. 2100 print#4,state$(x);:print#4,"   ";
  213. 2110 print#4,zip$(x)
  214. 2120 ifflag=0thenprint#4,ph$(x)
  215. 2130 ifflag=1thenprint#4:print#4:print#4:goto2160
  216. 2140 ifflag=0thenprint#4: